﻿<%@ Page Title="" Language="C#" MasterPageFile="~/YouOweMe.Master" AutoEventWireup="true" CodeBehind="AllDebts.aspx.cs" Inherits="YouOweMe.AllDebts" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

 <asp:ObjectDataSource ID="PeoplesObjectDataSource" 
       runat="server" TypeName="YouOweMe.BLL.PeopleManager"
       SelectMethod="GetAllPeople" />

 <asp:ListView ID="DebtsListView" runat="server"
    DataSourceID="PeoplesObjectDataSource">
        <LayoutTemplate>
            <table class="cross_table">
                <tr>
                    <td class="logo">
                        <%--<img src="App_Themes/Default/images/gray_redo.png" alt="debtsway" />--%>
                        <strong>Owes to</strong>
                    </td>
                    <asp:Repeater ID="headersReapeater" runat="server" DataSourceID="PeoplesObjectDataSource">
                        <ItemTemplate>
                            <th>
                                <%# Eval("Initials")%>
                            </th>
                        </ItemTemplate>
                    </asp:Repeater>
                </tr>
                <tr id="itemPlaceHolder" runat="server" />
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <%--<tr class='<%# Container.DataItemIndex % 2 == 0 ? "" : "alternating" %>' >--%>
            <tr>
                <td class="label">
                    <%# Eval("Initials")%>
                    <asp:HiddenField ID="indebtedIDHiddenField" runat="server"  Value='<%# Eval("ID") %>' />
                </td>
                 <asp:Repeater ID="cellsReapeater" runat="server" DataSourceID="PeoplesObjectDataSource">
                        <ItemTemplate>
                            <td>
                                <asp:HiddenField ID="lenderHiddenField" runat="server" Value='<%# Eval("ID") %>' />
                                <asp:ObjectDataSource ID="debtsObjectDataSource" runat="server" TypeName="YouOweMe.BLL.DebtManager"
                                    SelectMethod="GetDebts">
                                    <SelectParameters>
                                        <asp:ControlParameter Name="indebtedID" ControlID="indebtedIDHiddenField" PropertyName="Value"
                                            Type="Int64" />
                                        <asp:ControlParameter Name="lenderID" ControlID="lenderHiddenField" PropertyName="Value"
                                            Type="Int64" />
                                    </SelectParameters>
                                </asp:ObjectDataSource>
                                <asp:ListView ID="debtsListView" runat="server" DataSourceID="debtsObjectDataSource">
                                    <LayoutTemplate>
                                        <dl class="arrow">
                                            <asp:PlaceHolder ID="itemPlaceHolder" runat="server" />
                                        </dl>
                                    </LayoutTemplate>
                                    <ItemTemplate>
                                        <dt>
                                            <%# Eval("Amount") %>&nbsp;€&nbsp;</dt>
                                        <dd>
                                            <%# Eval("Comment") %></dd>
                                    </ItemTemplate>
                                    <EmptyDataTemplate>
                                        
                                    </EmptyDataTemplate>
                                </asp:ListView>
                            </td>
                        </ItemTemplate>
                </asp:Repeater>
            </tr>
        </ItemTemplate>
    </asp:ListView>
</asp:Content>
